package com.ethink.order.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.order.api.info.TocSaleAfterImportLogDetailInfo;
import com.ethink.order.common.entity.TocSaleAfterImportLogDetail;

/**
 * TOC售后导入日志明细 Converter转换器
 *
 * @author default
 * @date 2023-01-10
 */
@Component
public class TocSaleAfterImportLogDetailConverter implements Converter<TocSaleAfterImportLogDetailInfo, TocSaleAfterImportLogDetail> {

    @Override
    public TocSaleAfterImportLogDetail convertTo(TocSaleAfterImportLogDetailInfo info) {
        if(info == null) {
            return null;
        }
        TocSaleAfterImportLogDetail entity = new TocSaleAfterImportLogDetail ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public TocSaleAfterImportLogDetailInfo convertFrom(TocSaleAfterImportLogDetail entity) {
        if(entity == null) {
            return null;
        }
        TocSaleAfterImportLogDetailInfo info = new TocSaleAfterImportLogDetailInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
